<!-- 首页 -->
<template>
  
  <div class="all" style="height: 200vh;">
  <carousel-view :imgs="bannerImgs"/>
    <p>{{ userInfo.userName }}</p>
    <p>{{ categories }}</p>
    <p>{{ $store.getters['category/getChildrenByParentId'](0) }}</p>
   
  </div>
</template>

<script>
import { mapState } from 'vuex'
import CarouselView from '@/components/CarouselView.vue';
import {getCarousels} from '@/apis/carousel'
export default {
  components: {CarouselView},
  data() {
    return {
      bannerImgs:[]
    };
  },

  computed: {
    ...mapState('user', ['userInfo']),
    ...mapState('category', ['categories']),
  },

  watch: {},

  methods: {
    async getCarousel(){
            const res=await getCarousels()
            this.bannerImgs=res.data.records
        }
  },

  created() {

  },

  mounted() {
  this.getCarousel()
  }
}
</script>
<style lang='less' scoped>
//@import url(); 引入公共css类</style>